package cn.aiyuan.entity.permission;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * 权限表(Permission)实体类
 *
 * @author 痴
 * @since 2020-04-30 09:31:05
 */
@Data
@ApiModel(value = "PermissionDO", description = "权限表")
@TableName("permission")
public class Permission implements Serializable {

	private static final long serialVersionUID = 215947196272815570L;

	@ApiModelProperty(name = "id", value = "表唯一标识")
	@JsonProperty("id")
	private Long id;

	@ApiModelProperty(name = "label", value = "权限展示名称")
	@JsonProperty("label")
	private String label;

	@ApiModelProperty(name = "show", value = "是否显示 用于页面是否在菜单中显示")
	@JsonProperty("show")
	private Boolean display;

	@ApiModelProperty(name = "code", value = "后台权限控制使用的名称")
	@JsonProperty("code")
	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	private String code;

	@ApiModelProperty(name = "url", value = "访问时的url")
	@JsonProperty("url")
	private String url;

	@ApiModelProperty(name = "order", value = "排序")
	@JsonProperty("order")
	private Integer sort;

	@ApiModelProperty(name = "pId", value = "父级id 用于展示作用 最顶级默认为1")
	@JsonProperty("pId")
	private Long parentId;

	@ApiModelProperty(name = "init", value = "是否为初始权限 禁止删除编辑")
	@JsonProperty("init")
	private Boolean initial;

	@ApiModelProperty(name = "ena", value = "是否启用 true 启用 false 禁用")
	@JsonProperty("ena")
	private Boolean enable;

	@ApiModelProperty(name = "type", value = "菜单类型 还是接口类型 还是按钮类型 控制显隐和访问    menu  button  api")
	@JsonProperty("type")
	private String type;

	@JsonIgnore
	private Boolean deleted;

	@ApiModelProperty(name = "crTime", value = "创建时间", hidden = true)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@JsonProperty(value = "crTime")
	private Timestamp createTime;

	@ApiModelProperty(name = "crId", value = "创建人", hidden = true)
	@JsonProperty(value = "crId")
	private Long createId;

	@ApiModelProperty(name = "upTime", value = "修改时间", hidden = true)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@JsonProperty(value = "upTime")
	private Timestamp updateTime;

	@ApiModelProperty(name = "upId", value = "修改人", hidden = true)
	@JsonProperty(value = "upId")
	private Long updateId;

}
